package a.j;

import a.c.bb;
import a.c.d;
import a.c.e;
import a.d.w;
import a.j.a.*;
import a.j.a.f;
import a.j.a.j;
import a.j.a.n;
import a.j.a.o;

import javax.swing.*;
import java.awt.*;
import java.awt.datatransfer.DataFlavor;
import java.awt.datatransfer.Transferable;
import java.awt.datatransfer.UnsupportedFlavorException;
import java.awt.dnd.*;
import java.awt.event.MouseEvent;
import java.awt.image.BufferedImage;
import java.io.IOException;
import java.io.Serializable;
import java.lang.ref.WeakReference;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import java.util.*;

public class rb
{
  private static final String a = "com.yworks.DropSupport.Multiplexer";
  private static final String b = "com.yworks.DropSupport.splitAtMouseLocation";
  private static final String c = "com.yworks.DropSupport.mouseLocation";
  static boolean d = System.getProperty("os.name").toLowerCase().startsWith("mac os");
  static BufferedImage f = new BufferedImage(1, 1, 2);
  static Point g = new Point(0, 0);
  private HashMap h = new HashMap();
  private long i;
  private Object j;
  private z k = new z(null);
  boolean l;
  boolean m;
  boolean n;
  private DropTargetListener o;
  static final Method p;
  private boolean q;
  private j_ r;
  private static final DataFlavor s = new DataFlavor(x == null ? (rb.x = a("a.j.rb$e_")) : x, "Node");
  private static final DataFlavor t = new DataFlavor(y == null ? (rb.y = a("a.j.rb$g_")) : y, "Edge");
  private static final DataFlavor v = new DataFlavor(z == null ? (rb.z = a("a.j.rb$h_")) : z, "Data");
  static Class w;
  static Class x;
  static Class y;
  static Class z;
  public static int A;
  
  public rb()
  {
    this.k.f(false);
    this.m = true;
  }
  
  protected j_ a()
  {
    return new j_();
  }
  
  public j_ b()
  {
    if (!ld.E) {
      if (this.r == null) {
        this.r = a();
      }
    }
    return this.r;
  }
  
  public void a(j_ paramj_)
  {
    this.r = paramj_;
  }
  
  public rb(pg parampg)
  {
    this();
    c(parampg);
  }
  
  public void a(DragSource paramDragSource, DropTargetListener paramDropTargetListener, DragGestureEvent paramDragGestureEvent, Cursor paramCursor)
  {
    boolean bool = ld.E;
    this.o = paramDropTargetListener;
    if ((bool) || (d)) {
      if (!bool)
      {
        if (DragSource.isDragImageSupported())
        {
          if (bool) {
            break label82;
          }
          paramDragSource.startDrag(paramDragGestureEvent, paramCursor, f, g, new f_(new h_()), new DragSourceAdapter()
          {
            public void dragDropEnd(DragSourceDropEvent paramAnonymousDragSourceDropEvent)
            {
              rb.this.o = null;
            }
          });
        }
      }
      else if (!ld.D) {
        return;
      }
    }
    label82:
    paramDragSource.startDrag(paramDragGestureEvent, paramCursor, new f_(new h_()), new DragSourceAdapter()
    {
      public void dragDropEnd(DragSourceDropEvent paramAnonymousDragSourceDropEvent)
      {
        rb.this.o = null;
      }
    });
  }
  
  public void a(DragSource paramDragSource, ld paramld, DragGestureEvent paramDragGestureEvent, Cursor paramCursor)
  {
    boolean bool = ld.E;
    this.j = paramld;
    if ((bool) || (d)) {
      if (!bool)
      {
        if (DragSource.isDragImageSupported())
        {
          if (bool) {
            break label74;
          }
          paramDragSource.startDrag(paramDragGestureEvent, paramCursor, f, g, b(paramld), new DragSourceAdapter()
          {
            private final ld val$nr;
            
            public void dragDropEnd(DragSourceDropEvent paramAnonymousDragSourceDropEvent)
            {
              if ((ld.E) || (rb.this.j == this.val$nr))
              {
                rb.this.j = null;
                rb.this.o = null;
              }
            }
          });
        }
      }
      else if (!ld.D) {
        return;
      }
    }
    label74:
    paramDragSource.startDrag(paramDragGestureEvent, paramCursor, b(paramld), new DragSourceAdapter()
    {
      private final ld val$nr;
      
      public void dragDropEnd(DragSourceDropEvent paramAnonymousDragSourceDropEvent)
      {
        if ((ld.E) || (rb.this.j == this.val$nr))
        {
          rb.this.j = null;
          rb.this.o = null;
        }
      }
    });
  }
  
  public void a(DragSource paramDragSource, tb paramtb, DragGestureEvent paramDragGestureEvent, Cursor paramCursor)
  {
    boolean bool = ld.E;
    this.j = paramtb;
    if ((bool) || (d)) {
      if (!bool)
      {
        if (DragSource.isDragImageSupported())
        {
          if (bool) {
            break label74;
          }
          paramDragSource.startDrag(paramDragGestureEvent, paramCursor, f, g, a(paramtb), new DragSourceAdapter()
          {
            private final tb val$er;
            
            public void dragDropEnd(DragSourceDropEvent paramAnonymousDragSourceDropEvent)
            {
              if ((ld.E) || (rb.this.j == this.val$er))
              {
                rb.this.j = null;
                rb.this.o = null;
              }
            }
          });
        }
      }
      else if (!ld.D) {
        return;
      }
    }
    label74:
    paramDragSource.startDrag(paramDragGestureEvent, paramCursor, a(paramtb), new DragSourceAdapter()
    {
      private final tb val$er;
      
      public void dragDropEnd(DragSourceDropEvent paramAnonymousDragSourceDropEvent)
      {
        if ((ld.E) || (rb.this.j == this.val$er))
        {
          rb.this.j = null;
          rb.this.o = null;
        }
      }
    });
  }
  
  public boolean c()
  {
    return this.l;
  }
  
  public void a(boolean paramBoolean)
  {
    this.l = paramBoolean;
  }
  
  public boolean d()
  {
    return this.m;
  }
  
  public void b(boolean paramBoolean)
  {
    this.m = paramBoolean;
  }
  
  public boolean e()
  {
    return this.n;
  }
  
  public void c(boolean paramBoolean)
  {
    this.n = paramBoolean;
  }
  
  public z f()
  {
    return this.k;
  }
  
  public void a(z paramz)
  {
    this.k = paramz;
  }
  
  ld a(Transferable paramTransferable)
  {
    boolean bool = ld.E;
    ld localld = null;
    if ((bool) || ((this.j instanceof ld))) {
      localld = (ld)this.j;
    }
    if (!bool) {
      if (paramTransferable == null) {
        return localld;
      }
    }
    try
    {
      e_ locale_ = (e_)paramTransferable.getTransferData(s);
      return (ld)((WeakReference)this.h.get(locale_.a)).get();
    }
    catch (UnsupportedFlavorException localUnsupportedFlavorException)
    {
      return localld;
    }
    catch (IOException localIOException)
    {
      return localld;
    }
    catch (RuntimeException localRuntimeException) {}
    return localld;
  }
  
  tb c(Transferable paramTransferable)
  {
    boolean bool = ld.E;
    tb localtb = null;
    if ((bool) || ((this.j instanceof tb))) {
      localtb = (tb)this.j;
    }
    if (!bool) {
      if (paramTransferable == null) {
        return localtb;
      }
    }
    try
    {
      g_ localg_ = (g_)paramTransferable.getTransferData(t);
      return (tb)((WeakReference)this.h.get(localg_.a)).get();
    }
    catch (UnsupportedFlavorException localUnsupportedFlavorException)
    {
      return localtb;
    }
    catch (IOException localIOException)
    {
      return localtb;
    }
    catch (RuntimeException localRuntimeException) {}
    return localtb;
  }
  
  public void a(pg parampg)
  {
    JComponent localJComponent = parampg.B();
    if ((ld.E) || (a(localJComponent) == null))
    {
      i_ locali_ = new i_(null);
      new q_(localJComponent, locali_);
      localJComponent.putClientProperty("com.yworks.DropSupport.Multiplexer", locali_);
    }
  }
  
  public void b(pg parampg)
  {
    boolean bool = ld.E;
    JComponent localJComponent = parampg.B();
    i_ locali_ = a(localJComponent);
    if ((bool) || (locali_ != null))
    {
      locali_.a();
      localJComponent.putClientProperty("com.yworks.DropSupport.Multiplexer", null);
      if ((bool) || ((localJComponent.getDropTarget() instanceof q_))) {
        localJComponent.setDropTarget(null);
      }
    }
  }
  
  public void c(pg parampg)
  {
    a(parampg, s, new b_(parampg));
    a(parampg, t, new a_(parampg));
  }
  
  public void d(pg parampg)
  {
    a(parampg, s, null);
    a(parampg, t, null);
  }
  
  public void a(pg parampg, DataFlavor paramDataFlavor, DropTargetListener paramDropTargetListener)
  {
    boolean bool = ld.E;
    JComponent localJComponent = parampg.B();
    i_ locali_ = a(localJComponent);
    if (!bool) {
      if ((locali_ == null) && (paramDropTargetListener != null))
      {
        a(parampg);
        locali_ = a(localJComponent);
      }
    }
    if ((bool) || (locali_ != null)) {
      locali_.a(paramDataFlavor, paramDropTargetListener);
    }
  }
  
  public void a(pg parampg, DataFlavor paramDataFlavor)
  {
    a(parampg, paramDataFlavor, null);
  }
  
  private i_ a(JComponent paramJComponent)
  {
    return (i_)paramJComponent.getClientProperty("com.yworks.DropSupport.Multiplexer");
  }
  
  protected Rectangle a(ld paramld)
  {
    double d1 = paramld.a();
    double d2 = paramld.b();
    int i1 = (int)Math.floor(d1) - 10;
    int i2 = (int)Math.ceil(d1 + paramld.c()) + 10;
    int i3 = (int)Math.floor(d2) - 10;
    int i4 = (int)Math.ceil(d2 + paramld.d()) + 10;
    return new Rectangle(i1, i3, i2 - i1, i4 - i3);
  }
  
  protected void a(Graphics2D paramGraphics2D, ld paramld)
  {
    xf.c(paramGraphics2D, paramld);
  }
  
  protected qf e(pg parampg)
  {
    boolean bool2 = ld.E;
    boolean bool1 = ld.D;
    Iterator localIterator = parampg.s();
    qf localqf = null;
    do
    {
      do
      {
        gf localgf;
        do
        {
          if (!localIterator.hasNext()) {
            break;
          }
          localgf = (gf)localIterator.next();
        } while (!(localgf instanceof qf));
        if ((bool2) || (bool1)) {
          break label72;
        }
        localqf = (qf)localgf;
      } while (bool2);
    } while (!bool1);
    label72:
    return localqf;
  }
  
  private Transferable a(DropTargetDragEvent paramDropTargetDragEvent)
  {
    Transferable localTransferable = null;
    if ((ld.E) || (p != null)) {
      try
      {
        localTransferable = (Transferable)p.invoke(paramDropTargetDragEvent, new Object[0]);
      }
      catch (InvocationTargetException localInvocationTargetException) {}catch (IllegalAccessException localIllegalAccessException) {}catch (Exception localException) {}catch (Error localError) {}
    }
    return localTransferable;
  }
  
  protected boolean a(pg parampg, ld paramld, double paramDouble1, double paramDouble2)
  {
    boolean bool2 = ld.E;
    if (!bool2) {
      if (g())
      {
        g localg = parampg.a();
        localg.z();
        try
        {
          w localw1 = g(parampg);
          if (!bool2) {}
          w localw2 = localw1 == null ? new w(paramDouble1, paramDouble2) : localw1;
          j_ localj_ = b();
          d locald = a(localj_, parampg, localw2);
          e locale = b(parampg, paramld, paramDouble1, paramDouble2);
          if (locale != null)
          {
            if (locald != null) {
              localj_.a(parampg.a(), locald, localw2, locale);
            }
            parampg.L();
            localg.gb();
            bool1 = true;
            return bool1;
          }
          boolean bool1 = false;
          return bool1;
        }
        finally
        {
          localg.A();
        }
      }
    }
    if (b(parampg, paramld, paramDouble1, paramDouble2) != null)
    {
      parampg.L();
      parampg.a().gb();
      return true;
    }
    return false;
  }
  
  private static boolean f(pg parampg)
  {
    Object localObject = parampg.getClientProperty("com.yworks.DropSupport.splitAtMouseLocation");
    return Boolean.TRUE.equals(localObject);
  }
  
  private static w g(pg parampg)
  {
    boolean bool = ld.E;
    JComponent localJComponent = parampg.B();
    Object localObject = localJComponent.getClientProperty("com.yworks.DropSupport.mouseLocation");
    localJComponent.putClientProperty("com.yworks.DropSupport.mouseLocation", null);
    if ((bool) || ((f(parampg)) && ((bool) || ((localObject instanceof w))))) {
      return (w)localObject;
    }
    return null;
  }
  
  private static void a(pg parampg, w paramw)
  {
    JComponent localJComponent = parampg.B();
    localJComponent.putClientProperty("com.yworks.DropSupport.mouseLocation", paramw);
  }
  
  private static d a(j_ paramj_, pg parampg, w paramw)
  {
    try
    {
      return paramj_.a(parampg, paramw);
    }
    catch (Exception localException) {}
    return null;
  }
  
  protected e b(pg parampg, ld paramld, double paramDouble1, double paramDouble2)
  {
    boolean bool = ld.E;
    g localg = parampg.a();
    if (!bool)
    {
      paramld = paramld.m();
      if (parampg.u())
      {
        if (bool) {
          break label94;
        }
        double d1 = parampg.w();
        double d2 = Math.floor(paramDouble1 / d1 + 0.5D) * d1;
        double d3 = Math.floor(paramDouble2 / d1 + 0.5D) * d1;
        paramld.c(d2, d3);
        if (!ld.D) {
          break label93;
        }
      }
    }
    paramld.c(paramDouble1, paramDouble2);
    label93:
    label94:
    j localj = parampg.a().K();
    Object localObject1 = null;
    if (localj != null)
    {
      localObject2 = a(parampg, paramDouble1, paramDouble2, true);
      e locale = ((sc)localObject2).m();
      if (locale != null)
      {
        if (!bool) {
          if (localj.m(locale))
          {
            localObject1 = locale;
            break label164;
          }
        }
        localObject1 = localj.p(locale);
      }
    }
    label164:
    if (!bool) {
      if (localObject1 != null) {
        localg.z();
      }
    }
    Object localObject2 = a(localg, paramld);
    if (!bool) {
      if (localObject1 != null)
      {
        a((e)localObject2, (e)localObject1);
        localg.A();
      }
    }
    return localObject2;
  }
  
  public boolean g()
  {
    return this.q;
  }
  
  public void d(boolean paramBoolean)
  {
    this.q = paramBoolean;
  }
  
  private sc a(pg parampg, double paramDouble1, double paramDouble2, boolean paramBoolean)
  {
    uc localuc = parampg.P();
    if (localuc == null)
    {
      if (paramBoolean) {
        return new sc(parampg, paramDouble1, paramDouble2, true, 4);
      }
      return new sc(parampg, paramDouble1, paramDouble2, true);
    }
    if (!ld.E) {}
    int i1 = paramBoolean ? 1 : -1;
    return localuc.a(paramDouble1, paramDouble2, i1, true);
  }
  
  private e a(g paramg, ld paramld)
  {
    boolean bool2 = ld.E;
    boolean bool1 = ld.D;
    ld localld1 = paramld;
    ld localld2 = paramld;
    if ((bool2) || ((paramld instanceof qd)))
    {
      localObject = (qd)paramld;
      localld1 = ((qd)localObject).i();
      if (!bool2) {
        if (((qd)localObject).h() > 1)
        {
          if (!bool2) {}
          localld2 = localld1 == ((qd)localObject).f(0) ? ((qd)localObject).f(1) : ((qd)localObject).f(0);
          if (bool2) {
            break label109;
          }
          localld2.c(localld1.A(), localld1.B());
          if (!bool1) {
            break label111;
          }
        }
      }
      label109:
      localld2 = localld1;
    }
    label111:
    Object localObject = paramg.K();
    if ((localObject != null) && ((bool2) || ((((localld1 instanceof o)) || ((bool2) || ((localld1 instanceof n)))) && ((bool2) || ((((j)localObject).b() instanceof a))))))
    {
      a locala = (a)((j)localObject).b();
      ld localld3 = locala.b();
      ld localld4 = locala.c();
      paramg.z();
      e locale;
      if (!bool2)
      {
        if (((f)localld1).h())
        {
          locala.a(localld2);
          locala.b(localld1);
          locale = ((j)localObject).b(paramg);
          if (bool2) {
            break label277;
          }
          if (!bool1) {}
        }
        else
        {
          locala.a(localld1);
          locala.b(localld2);
        }
      }
      else {
        locale = ((j)localObject).c(paramg);
      }
      paramg.A();
      locala.b(localld4);
      locala.a(localld3);
      label277:
      return locale;
    }
    return paramg.a(paramld);
  }
  
  protected void a(e parame1, e parame2)
  {
    boolean bool = ld.E;
    g localg = (g)parame1.g();
    j localj = j.a(localg);
    b localb = null;
    if (parame2 != null) {
      localb = localg.w(parame2).K();
    }
    if ((bool) || (localb != null)) {
      if (bool) {}
    }
    int i1 = localb.e() ? 1 : 0;
    if (!bool) {
      if (i1 != 0)
      {
        localg.a(new bb(parame2).l());
        localb.a(false);
      }
    }
    try
    {
      localj.c(parame1, parame2);
      if (bool) {}
    }
    finally
    {
      if (i1 != 0) {
        localb.a(true);
      }
    }
  }
  
  protected boolean a(pg parampg, tb paramtb, double paramDouble1, double paramDouble2)
  {
    boolean bool2 = ld.E;
    boolean bool1 = ld.D;
    qf localqf = e(parampg);
    if (localqf != null)
    {
      if (bool2) {
        break label496;
      }
      if ((a(localqf)) && ((bool2) || (localqf.i() == null)))
      {
        gf localgf = localqf.hb();
        if (bool2) {
          break label496;
        }
        if ((localgf instanceof pf))
        {
          pf localpf = (pf)localgf;
          g localg = parampg.a();
          tb localtb = localg.O();
          if (paramtb != null) {
            localg.a(paramtb);
          }
          Point localPoint = new Point(parampg.d(paramDouble1), parampg.e(paramDouble2));
          if (!bool2) {
            if (localpf.i == null)
            {
              localpf.i = parampg;
              locale = localpf.a(paramDouble1, paramDouble2).m();
              if (bool2) {
                break label169;
              }
              localpf.i = null;
              if (!bool1) {
                break label180;
              }
            }
          }
          label169:
          e locale = localpf.a(paramDouble1, paramDouble2).m();
          label180:
          if (locale != null)
          {
            if (bool2) {
              break label217;
            }
            if (localpf.acceptSourceNode(locale, paramDouble1, paramDouble2)) {}
          }
          else
          {
            return false;
          }
          if ((bool2) || (localg.y(locale))) {
            label217:
            localg.a(locale, false);
          }
          long l1 = System.currentTimeMillis() - 6L;
          localqf.mousePressed(new MouseEvent(parampg.B(), 501, l1++, 16, localPoint.x, localPoint.y, 0, false, 1));
          localqf.mouseDragged(new MouseEvent(parampg.B(), 506, l1++, 16, localPoint.x + 1000, localPoint.y + 1000, 0, false));
          if (!bool2) {
            if (localqf.i() != localpf)
            {
              localqf.mouseDragged(new MouseEvent(parampg.B(), 506, l1++, 16, localPoint.x, localPoint.y, 0, false));
              localqf.mouseReleased(new MouseEvent(parampg.B(), 502, l1++, 0, localPoint.x, localPoint.y, 0, false, 1));
              parampg.a().gb();
              if (bool2) {
                break label494;
              }
              if (!bool1) {
                break label484;
              }
            }
          }
          localqf.mouseDragged(new MouseEvent(parampg.B(), 506, l1++, 16, localPoint.x, localPoint.y, 0, false));
          localpf.q(false);
          label484:
          parampg.a().a(localtb);
          label494:
          return true;
        }
      }
    }
    label496:
    return false;
  }
  
  protected boolean a(qf paramqf)
  {
    return paramqf.P();
  }
  
  public Transferable b(ld paramld)
  {
    String str = Long.toString(this.i++);
    this.h.put(str, new WeakReference(paramld));
    e_ locale_ = new e_();
    locale_.a = str;
    return new d_(locale_);
  }
  
  public Transferable a(tb paramtb)
  {
    String str = Long.toString(this.i++);
    this.h.put(str, new WeakReference(paramtb));
    g_ localg_ = new g_();
    localg_.a = str;
    return new c_(localg_);
  }
  
  static Class a(String paramString)
  {
    try
    {
      return Class.forName(paramString);
    }
    catch (ClassNotFoundException localClassNotFoundException)
    {
      throw new NoClassDefFoundError(localClassNotFoundException.getMessage());
    }
  }
  
  static
  {
    Method localMethod = null;
    try
    {
      localMethod = (w == null ? (rb.w = a("java.awt.dnd.DropTargetDragEvent")) : w).getMethod("getTransferable", new Class[0]);
    }
    catch (NoSuchMethodException localNoSuchMethodException) {}catch (Exception localException) {}catch (Error localError) {}
    p = localMethod;
  }
  
  public static class j_
    extends gd
  {
    public static int c;
  }
  
  private static final class q_
    extends DropTarget
  {
    public q_(Component paramComponent, DropTargetListener paramDropTargetListener)
      throws HeadlessException
    {
      super(paramDropTargetListener);
    }
  }
  
  static final class f_
    implements Transferable
  {
    private rb.h_ a;
    
    f_(rb.h_ paramh_)
    {
      this.a = paramh_;
    }
    
    public DataFlavor[] getTransferDataFlavors()
    {
      return new DataFlavor[] { rb.v };
    }
    
    public boolean isDataFlavorSupported(DataFlavor paramDataFlavor)
    {
      return rb.v.equals(paramDataFlavor);
    }
    
    public Object getTransferData(DataFlavor paramDataFlavor)
      throws UnsupportedFlavorException, IOException
    {
      if (paramDataFlavor != rb.v) {
        throw new UnsupportedFlavorException(paramDataFlavor);
      }
      return this.a;
    }
  }
  
  static final class c_
    implements Transferable
  {
    private final rb.g_ a;
    
    c_(rb.g_ paramg_)
    {
      this.a = paramg_;
    }
    
    public Object getTransferData(DataFlavor paramDataFlavor)
      throws UnsupportedFlavorException, IOException
    {
      if (paramDataFlavor != rb.t) {
        throw new UnsupportedFlavorException(paramDataFlavor);
      }
      return this.a;
    }
    
    public DataFlavor[] getTransferDataFlavors()
    {
      return new DataFlavor[] { rb.t };
    }
    
    public boolean isDataFlavorSupported(DataFlavor paramDataFlavor)
    {
      return rb.t.equals(paramDataFlavor);
    }
  }
  
  static final class d_
    implements Transferable
  {
    private final rb.e_ a;
    
    d_(rb.e_ parame_)
    {
      this.a = parame_;
    }
    
    public Object getTransferData(DataFlavor paramDataFlavor)
      throws UnsupportedFlavorException, IOException
    {
      if (paramDataFlavor != rb.s) {
        throw new UnsupportedFlavorException(paramDataFlavor);
      }
      return this.a;
    }
    
    public DataFlavor[] getTransferDataFlavors()
    {
      return new DataFlavor[] { rb.s };
    }
    
    public boolean isDataFlavorSupported(DataFlavor paramDataFlavor)
    {
      return rb.s.equals(paramDataFlavor);
    }
  }
  
  static final class h_
    implements Serializable
  {
    String a;
  }
  
  static final class g_
    implements Serializable
  {
    String a;
  }
  
  static final class e_
    implements Serializable
  {
    String a;
  }
  
  private class b_
    implements DropTargetListener
  {
    private Point2D.Double a;
    private oc b;
    private a_ c;
    private qb d;
    private Point2D.Double e;
    private final pg f;
    private ld g;
    private final rb.j_ h;
    private boolean i;
    
    public b_(pg parampg)
    {
      this.f = parampg;
      this.a = new Point2D.Double();
      this.b = new oc(parampg);
      this.c = new a_();
      this.h = rb.this.b();
      this.d = this.h.a();
      this.b.a(this.c);
      this.b.a(this.d);
      this.b.a(rb.this.k.e());
      this.e = new Point2D.Double();
    }
    
    public void dragEnter(DropTargetDragEvent paramDropTargetDragEvent)
    {
      boolean bool = ld.E;
      this.i = false;
      ld localld1;
      try
      {
        localld1 = rb.this.a(rb.this.a(paramDropTargetDragEvent));
      }
      catch (InvalidDnDOperationException localInvalidDnDOperationException)
      {
        localld1 = null;
      }
      if (localld1 != null)
      {
        a(paramDropTargetDragEvent);
        Point localPoint = paramDropTargetDragEvent.getLocation();
        this.a.x = this.f.f(localPoint.x);
        this.a.y = this.f.g(localPoint.y);
        if (!bool) {
          if (!rb.this.m)
          {
            if (bool) {
              break label225;
            }
            if (!rb.this.l) {
              break label210;
            }
          }
        }
        Object localObject = this.c.a;
        ((g)localObject).o();
        ld localld2 = localld1.m();
        localld2.c(this.a.x, this.a.y);
        e locale = ((g)localObject).a(localld2);
        this.g = ((g)localObject).w(locale);
        this.e.x = this.g.A();
        this.e.y = this.g.B();
        if (!bool) {
          if (ld.D)
          {
            label210:
            this.e.x = this.a.x;
            label225:
            this.e.y = this.a.y;
          }
        }
        if (!bool) {
          if (rb.this.m) {
            this.f.a(this.c);
          }
        }
        if (!bool) {
          if (rb.this.g())
          {
            this.i = rb.f(this.f);
            if (bool) {
              break label360;
            }
            if (c())
            {
              this.h.a(this.f, this.a.x, this.a.y, this.d);
              this.f.b(this.d);
              this.f.a(this.d);
            }
          }
        }
        if (rb.this.l)
        {
          label360:
          localObject = new ArrayList(1);
          ((ArrayList)localObject).add(this.g.n());
          rb.this.k.a(this.f);
          rb.this.k.a(new w(this.a.x, this.a.y), (Collection)localObject, Collections.EMPTY_LIST, Collections.EMPTY_SET, q.a(new Rectangle2D.Double(this.g.a(), this.g.b(), this.g.c(), this.g.d())));
          this.b.e();
        }
      }
    }
    
    private void a(DropTargetDragEvent paramDropTargetDragEvent)
    {
      boolean bool = ld.E;
      if (!bool)
      {
        if (b(paramDropTargetDragEvent))
        {
          if (bool) {
            break label32;
          }
          paramDropTargetDragEvent.acceptDrag(3);
        }
      }
      else if (!ld.D) {
        return;
      }
      label32:
      paramDropTargetDragEvent.rejectDrag();
    }
    
    private boolean b(DropTargetDragEvent paramDropTargetDragEvent)
    {
      boolean bool2 = ld.E;
      boolean bool1 = ld.D;
      DataFlavor[] arrayOfDataFlavor = paramDropTargetDragEvent.getCurrentDataFlavors();
      int j = 0;
      do
      {
        do
        {
          if (j >= arrayOfDataFlavor.length) {
            break;
          }
          if (arrayOfDataFlavor[j] == rb.s) {
            return true;
          }
          j++;
        } while (!bool1);
      } while (bool2);
      return false;
    }
    
    public void drop(DropTargetDropEvent paramDropTargetDropEvent)
    {
      boolean bool2 = ld.E;
      boolean bool1 = ld.D;
      Point localPoint = paramDropTargetDropEvent.getLocation();
      double d1 = this.f.f(localPoint.x);
      double d2 = this.f.g(localPoint.y);
      w localw;
      if ((bool2) || (rb.this.l))
      {
        localw = rb.this.k.b(new w(d1, d2));
        if (bool2) {
          break label103;
        }
        if (!bool1) {}
      }
      else
      {
        localw = new w(d1, d2);
      }
      a();
      try
      {
        label103:
        ld localld = rb.this.a(paramDropTargetDropEvent.getTransferable());
        if (localld != null)
        {
          double d3;
          if ((bool2) || ((rb.this.m) || ((bool2) || (rb.this.l))))
          {
            d3 = this.e.x + localw.a - this.a.x;
            d4 = this.e.y + localw.b - this.a.y;
            if (!bool2) {
              if (!bool1) {
                break label214;
              }
            }
          }
          else
          {
            d3 = d1;
          }
          double d4 = d2;
          label214:
          rb.a(this.f, this.i ? new w(d1, d2) : null);
          if (bool2) {
            break label275;
          }
          paramDropTargetDropEvent.dropComplete(rb.this.a(this.f, localld, d3, d4));
          if (!bool1) {
            return;
          }
        }
        label275:
        paramDropTargetDropEvent.dropComplete(false);
      }
      catch (RuntimeException localRuntimeException)
      {
        paramDropTargetDropEvent.dropComplete(false);
        throw localRuntimeException;
      }
    }
    
    private void a()
    {
      this.f.b(this.d);
      this.f.b(this.c);
      this.f.a().gb();
      if ((ld.E) || (rb.this.l))
      {
        rb.this.k.g();
        this.b.e();
      }
    }
    
    public void dragExit(DropTargetEvent paramDropTargetEvent)
    {
      a();
    }
    
    public void dropActionChanged(DropTargetDragEvent paramDropTargetDragEvent)
    {
      a(paramDropTargetDragEvent);
    }
    
    public void dragOver(DropTargetDragEvent paramDropTargetDragEvent)
    {
      boolean bool2 = ld.E;
      ld localld = this.g;
      int j = (rb.this.m) && (localld != null) ? 1 : 0;
      boolean bool1 = c();
      if ((bool2) || ((j != 0) || (bool1)))
      {
        Point localPoint = paramDropTargetDragEvent.getLocation();
        double d1 = this.f.f(localPoint.x);
        double d2 = this.f.g(localPoint.y);
        if (!bool2) {
          if (j != 0)
          {
            w localw;
            if ((bool2) || (rb.this.l))
            {
              localw = rb.this.k.b(new w(d1, d2));
              if (bool2) {
                break label159;
              }
              if (!ld.D) {}
            }
            else
            {
              localw = new w(d1, d2);
            }
            if (!this.i)
            {
              label159:
              d1 = localw.a;
              d2 = localw.b;
            }
            localld.c(this.e.x + localw.a - this.a.x, this.e.y + localw.b - this.a.y);
          }
        }
        if (bool1) {
          this.h.a(this.f, d1, d2, this.d);
        }
        this.b.e();
      }
      a(paramDropTargetDragEvent);
    }
    
    private boolean c()
    {
      return this.h.b();
    }
    
    class a_
      implements qb
    {
      g a = new g();
      hc b = new mb();
      
      a_() {}
      
      public void paint(Graphics2D paramGraphics2D)
      {
        this.b.a(paramGraphics2D, this.a);
      }
      
      public Rectangle getBounds()
      {
        return this.a.d();
      }
    }
  }
  
  private class a_
    implements DropTargetListener
  {
    private final pg a;
    private final oc b;
    private final b_ c;
    private pf d;
    
    public a_(pg parampg)
    {
      this.a = parampg;
      this.b = new oc(parampg);
      this.c = new b_();
      this.b.a(this.c);
    }
    
    public void dragEnter(DropTargetDragEvent paramDropTargetDragEvent)
    {
      boolean bool = ld.E;
      if (!bool)
      {
        if (rb.this.e())
        {
          this.a.b(this.c);
          this.a.a(this.c);
        }
      }
      else
      {
        qf localqf = rb.this.e(this.a);
        if ((bool) || (localqf != null))
        {
          gf localgf = localqf.hb();
          if ((localgf instanceof pf)) {
            this.d = ((pf)localgf);
          }
        }
        a(paramDropTargetDragEvent);
      }
      paramDropTargetDragEvent.acceptDrag(paramDropTargetDragEvent.getSourceActions() & 0x3);
    }
    
    public void dragOver(DropTargetDragEvent paramDropTargetDragEvent)
    {
      if ((ld.E) || (rb.this.e())) {
        a(paramDropTargetDragEvent);
      }
    }
    
    public void dropActionChanged(DropTargetDragEvent paramDropTargetDragEvent) {}
    
    public void dragExit(DropTargetEvent paramDropTargetEvent)
    {
      if (!ld.E)
      {
        if (rb.this.e())
        {
          this.d = null;
          this.a.b(this.c);
        }
      }
      else {
        this.a.b();
      }
    }
    
    public void drop(DropTargetDropEvent paramDropTargetDropEvent)
    {
      boolean bool = rb.this.e();
      if (!ld.E)
      {
        if (bool) {
          this.d = null;
        }
      }
      else {
        this.a.b(this.c);
      }
      tb localtb = rb.this.c(paramDropTargetDropEvent.getTransferable());
      Point localPoint = paramDropTargetDropEvent.getLocation();
      double d1 = this.a.f(localPoint.x);
      double d2 = this.a.g(localPoint.y);
      paramDropTargetDropEvent.dropComplete(rb.this.a(this.a, localtb, d1, d2));
      if (bool) {
        this.a.b();
      }
    }
    
    private void a(DropTargetDragEvent paramDropTargetDragEvent)
    {
      boolean bool2 = ld.E;
      boolean bool1 = ld.D;
      Point localPoint = paramDropTargetDragEvent.getLocation();
      double d1 = this.a.f(localPoint.x);
      double d2 = this.a.g(localPoint.y);
      if (!bool2) {
        if (this.d == null)
        {
          localObject = this.a.P().a(d1, d2, 1, true);
          if (!bool2)
          {
            if (((sc)localObject).x())
            {
              this.c.a(this.a.a().w(((sc)localObject).m()));
              if (bool2) {
                return;
              }
              if (!bool1) {
                break label270;
              }
            }
            this.c.a(null);
            if (bool2) {
              return;
            }
          }
          if (!bool1) {
            break label270;
          }
        }
      }
      if (!bool2) {
        if (this.d.i == null)
        {
          this.d.i = this.a;
          localObject = this.d.a(d1, d2).m();
          if (bool2) {
            break label197;
          }
          this.d.i = null;
          if (!bool1) {
            break label208;
          }
        }
      }
      label197:
      Object localObject = this.d.a(d1, d2).m();
      label208:
      if (localObject != null)
      {
        if (bool2) {
          break label252;
        }
        if (this.d.acceptSourceNode((e)localObject, d1, d2)) {}
      }
      else
      {
        this.c.a(null);
        if (bool2) {
          return;
        }
        if (!bool1) {
          break label270;
        }
      }
      label252:
      this.c.a(this.a.a().w((e)localObject));
      label270:
      this.b.e();
    }
    
    final class b_
      implements qb
    {
      private ld a;
      
      b_() {}
      
      public Rectangle getBounds()
      {
        if (!ld.E) {
          if (this.a == null) {
            return new Rectangle(0, 0, -1, -1);
          }
        }
        return rb.this.a(this.a);
      }
      
      public void paint(Graphics2D paramGraphics2D)
      {
        if ((ld.E) || (this.a != null)) {
          rb.this.a(paramGraphics2D, this.a);
        }
      }
      
      void a(ld paramld)
      {
        this.a = paramld;
      }
    }
  }
  
  private final class i_
    implements DropTargetListener
  {
    private final Map a = new HashMap();
    
    private i_() {}
    
    public void a(DataFlavor paramDataFlavor, DropTargetListener paramDropTargetListener)
    {
      boolean bool = ld.E;
      if (!bool) {
        if (paramDropTargetListener != null)
        {
          if (bool) {
            break label44;
          }
          this.a.put(paramDataFlavor, paramDropTargetListener);
          if (!ld.D) {
            return;
          }
        }
      }
      label44:
      this.a.remove(paramDataFlavor);
    }
    
    public void a()
    {
      this.a.clear();
    }
    
    public void dragEnter(DropTargetDragEvent paramDropTargetDragEvent)
    {
      boolean bool2 = ld.E;
      boolean bool1 = ld.D;
      if (!bool2) {
        if (rb.this.o == null)
        {
          DataFlavor[] arrayOfDataFlavor = paramDropTargetDragEvent.getCurrentDataFlavors();
          int i = 0;
          do
          {
            if (i >= arrayOfDataFlavor.length) {
              break;
            }
            DataFlavor localDataFlavor = arrayOfDataFlavor[i];
            DropTargetListener localDropTargetListener = (DropTargetListener)this.a.get(localDataFlavor);
            if (bool1) {
              break label109;
            }
            if (localDropTargetListener != null)
            {
              if (bool2) {
                break label106;
              }
              rb.this.o = localDropTargetListener;
              if (!bool1) {
                break;
              }
            }
            i++;
          } while (!bool1);
        }
      }
      label106:
      if ((bool2) || (rb.this.o != null))
      {
        label109:
        rb.this.o.dragEnter(paramDropTargetDragEvent);
        if (!bool1) {}
      }
      else
      {
        paramDropTargetDragEvent.rejectDrag();
      }
    }
    
    public void dragExit(DropTargetEvent paramDropTargetEvent)
    {
      if ((ld.E) || (rb.this.o != null)) {
        rb.this.o.dragExit(paramDropTargetEvent);
      }
    }
    
    public void dragOver(DropTargetDragEvent paramDropTargetDragEvent)
    {
      if ((ld.E) || (rb.this.o != null)) {
        rb.this.o.dragOver(paramDropTargetDragEvent);
      }
    }
    
    public void drop(DropTargetDropEvent paramDropTargetDropEvent)
    {
      if (!ld.E)
      {
        if (rb.this.o != null) {
          rb.this.o.drop(paramDropTargetDropEvent);
        }
      }
      else
      {
        rb.this.o = null;
        if (!ld.D) {
          return;
        }
      }
      paramDropTargetDropEvent.dropComplete(false);
    }
    
    public void dropActionChanged(DropTargetDragEvent paramDropTargetDragEvent)
    {
      if ((ld.E) || (rb.this.o != null))
      {
        rb.this.o.dropActionChanged(paramDropTargetDragEvent);
        if (!ld.D) {}
      }
      else
      {
        paramDropTargetDragEvent.rejectDrag();
      }
    }
    
    i_(rb.10 param10)
    {
      this();
    }
  }
}



/* Location:           E:\idea\

 * Qualified Name:     a.j.rb

 * JD-Core Version:    0.7.0.1

 */